
Crush2D Engine features
****************************

physics engine
**************

body definition
  C2D - polygon definition (only) - can be concave - automatic border by the texture and triangle tesselation, object polygon may contain many points and still the algos for collision detection is great (working linearly)
  Other engines - circle, triangle, box, rectangle, simple polygon definition (f.e. up to a few of vertices, may not be concave, may not contain very thin triangles...)

terrain definition
  terrain can be large in C2D, more static objects doesn't make collision detection slower. the terrain vector border is also automatically 
  optimized, so when there are more static objects on one place, they all have like one border only.
  terrain will contain more features, f.e. friction(slippery) settings, restitution settings, a static object can became dynamic (the big rock will be broken off the terrain with bullets...)

objects penetration 
  It is unavoidable in physics simulations
  C2D is solving penetration and un-penetration algos in a different way than other engines

(multi) constraint solver
  common problem in the constraint solver is high mass ratio of objects (one object in much heavier than the other, 
  constraints between objects must be solved many times in solvers)
  it is usually a bottleneck in the engines, when there are more objects in a pile
  
collision detection
  again different way in C2D than in the other engines
  high speed objects require more position iterations to avoid flying through the objects
  C2D doesn't use position iterations to find these collisions, instead it solves each border point and each border line movement in the simulation space

gravity
  physics engines use low gravity to demonstrate nice behaviour of physics
  higher gravity requires more calculations in physics simulations or it
  produces more errors in dynamics (f.e. more penetration, object flying through object,...)
  higher gravity (or other forces acting on objects, like jets, motors,...) usually require higher frequency of dynamics solver (or more position and velocity iterations)

joints
  again there are several algos to solve joints dynamics, that also may depend on features of joints
  C2D needs more features of joints, now we've got motor, dumping, angular friction, angular spring - these features still need to be updated in C2D, not solved very correctly.
  Constraints on joints are solved very well in C2D, also with high mass ratio of objects.
  Other engines offer more types of joints (prismatic, distance, revolute, pulley, gear joint,....) this we plan to make as features of joint, that can be combined for one joint.

+ fracturing of objects
+ plastic deformations (with various settings for material) (we plan elastic deformations, too)
+ particle systems (interacting with objects, can deform objects, too, planning much more features)
+ simple motion blur (planning a little better one in future)
+ blueprints 
  blueprint is a class containing more objects jointed together
  blueprint can contain particle systems, too (usefull for jets, bullets, etc.)
  blueprint class contains various features that need to be coded inside the core of physics engine
  and will contain much more features for game needs
  i didn't find such a class in physics engines
+ simple ligths (can make good look of the scene, switching on and off the lights (f.e. in caves))
+ determinism - it is working ok so far and we plan to use it for replays, recordings and multiplayer

Planned features:
elastic deformations
water
magnets (f.e. useful for explosions)
animations (f.e. useful for rotating cannons)
much more particle system features (motion blur, animated particles, combined particles, ...)
sensors (useful for AI, lifts, ...)


graphics engine 
***************
- opengl / directx, using basic api (no shaders)
- 2D world in 3D space, paralax layers, advanced possibilities
- using lights to make it nice look, (no shaddows), possibility to switch on/off (an a cave f.e.)
- motion blur for fast movements
- all will be anti-aliased thanks to using anti-aliased RGBA PNG pictures. for broken pieces of objects ( that are not anti-aliased so far) we'll make advanced rendering that will make it anti-aliased, too


???? want more info about objects, joints, robots and particle systems?

awesomium
*********
- web window editor possible to use local and online
- supports html, javascript
- editor now sends lua scripts to game application
- planning to use online web in game (game news, player can create and upload his robots, scenes,...)
 
lua
***
- lua console (wanna lua script commands list?)
- we'll use lua for scripting many things (AI, game scripts, scenario, additional vehicle design and behaviour, editor, special editing requirements, etc.)

editor
******
- started to work on, can edit terrain only so far
- can edit terrain while game runs, good because it's easy to try physics imediately after edit
- also can pause game and edit scene while paused
- will be joined with awesomium editor to see and set-up properties of objects
- planning that the players can draw and edit robots and scenes and upload them
- we'll be possible to edit all in game, the only input will be textures
- we'll edit: 
  1: dynamic objects (an object made from one texture, has many properties to set-up, f.e. density, border properties, deformation parameters, break parameters, slippery, etc.)
  2: joints 
  3: particle systems (many possibilities and for many purposes, they have many players that can be combined, can be interactive or not, can be linked to object, etc.)
  4: robots (a pile of objects, joints and particle systems, contain many functions and will contain many parameters, too)
  5: terrain objects (static objects that can be edited now, will edit more parameters like slippery, restitution, collide parameters, advanced lighting parameters, etc.)
  6: scene settings and game script (various settings for the scene and the play script)

determinism
***********
- all the code is done to keep determinism, for random numbers we use random seeds (we use great random seed algorithm that is very random and uses low CPU)
- each object in C2D (that needs random numbers) uses it's own random seed (for later milti-thread purposes and to keep determinism in multi-threaded mode, too)
- will use determinism to make game replays and multiplayer. Only keyboard and mouse changes are saved to buffer (or will be sent via network) and all the scene determinism works ok to replay gameplay
- to show replay, do:
 1: switch of the editor (F2) and go to game mode (Esc)
 2: reset the scene (ctrl+R)
 3: play with vehicles
 4: press ctrl+shift+R to replay
- we have a determinism checker, so we can test whether the determinism is not corrupted and we can locate area of the code where the determinism is corrupted (by my opinion a very interesting feature!)
- determinism will be a challenge in cross-platform (I was studying it and will continue in it)
- if someting happens anyway and the determinism will be corrupted while playing multiplayer via network, then 
  that could be very bad because it could interrupt the playing, but here we still have an answer: we'll dump whole game data from one player and copy it to all other players via network and the game can continue

portability
***********
- game runs on windows only so far, we plan to port it on other platforms, too
that's wy we use only a few third party libs, that are portable and made extra layers in code to make it easy to use and/or replace with another lib
- libs that we use: 
 1: Devil (loading images)
 2: SDL (cross-platform input, timer, opengl api)
 3: Awesomium (web windows, java)
 4: Lua,Luabind, and Boost library (boost lib only because of Luabind library needs it, we don't)
- coding all basic stuff in C2D Core library will help a lot to port C2D.
- C2D Core library contains very well written classes, so far all that are needed to make good engine. (checking all important functions in assembler and updating so they're optimized to use less CPU, less "doubled-data", less jumps and in that way we use more memory cached values that improves performance)
- C2D Core features: advanced indexed and multi indexed arrays, world grid, a lot of math on points, lines, triangles, boundboxes, polygons, bezier curves, timing intervals, colors, matrices, random seed, automatic picture border find by alpha channel, Voronoi tessellation of polygons, etc.
- planing to use premake

others
******
- planning to use native client (google NaCl)